<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Helper extends MY_Controller  
{
    public function __construct() 
    {
        parent::__construct();
    }
    
    function urlHelper() 
    {
    	$this->load->helper('url');
    	
    	// Returns your site base URL, as specified in your config file.
		echo base_url();
		echo '<br>';
		
		// Returns the full URL (including segments) of the page being currently viewed.
		echo current_url();
		echo '<br>';
		
		// Creates a standard HTML email link.
		// It writes an obfuscated version of the mailto tag using ordinal numbers written with JavaScript to help prevent the email address from being harvested by spam bots.
		echo safe_mailto('me@my-site.com', 'Click Here to Contact Me');
		echo '<br>';
		
		// Not work with utf8
		echo url_title('Chu se them gach ngang    nhe! ', TRUE);
		
		//redirect('/login/form/');
    }

    function textHelper() 
    {
    	$this->load->helper('text');

    	// đếch đếm chuẩn
    	header('Content-Type: text/html; charset=utf-8');
		echo character_limiter('Tiếng việt xem thế nào Here is a nice text string consisting of eleven words.', 9);
		echo '<br>';
    }
}